
extends public_menu
block person_menu_content
    if(login_user && login_user.id === user.id)
        p(style="text-align:right;")
            a(href="/user/private/#{user.nick}/menu/publish").btn.btn-default 发布菜单
    if(!menus || menus.length==0)
        div.text-center 你还没有发布任何菜单哦~
    else
        mixin item(menu)
            div.wrapper
                a(href="/menu/detail/#{menu.id}", alt="#{menu.name}" target="_blank")
                    img(src="#{menu.finishedProductImage || '/images/menu_default.jpg'}", alt="#{menu.name}")
                p.title #{menu.name}
                div.bottom-panel
                    span.left #{dateformat(menu.createOn)}
                    div.inline.right
                        span.glyphicon.glyphicon-heart
                        |  #{menu.upvote}
                        span.glyphicon.glyphicon-comment
                        |  #{menu.comment}
        mixin panel(index)
            if(index < menus.length)
                if(index % 4 === 0)
                    div.item-panel
                        + item(menus[index])
                    + panel(index + 4)
                else
                    div.item-panel(style="margin-left:8px")
                        + item(menus[index])
                    + panel(index + 4)

        - var quality = menus.length > 4 ? 4 : menus.length
        - for(var i=0; i<quality; i++){
            div(style='display:block;float:left;width:274px')
                + panel(i)
        - }
    div.clearfix
